const String tablePost = 'bt_post';
const String columnAuthorId = 'author_id';
const String columnAuthorName = 'author_name';
const String columnAvatar = 'avatar';
const String columnTitle = 'title';
const String columnSubTitle = 'sub_title';
const String columnContent = 'content';
const String columnFollowed = 'followed';
const String columnCover = 'cover';
const String columnPicUrls = 'pic_urls';
const String columnComments = 'comments';
const String columnLikes = 'likes';
const String columnLikeStatuses = 'like_statuses';
const String columnFollowStatuses = 'follow_statuses';
const String columnSenders = 'senders';

class BtPost {
  late String authorId;
  late String authorName;
  late String avatar;
  late String title;
  late String subTitle;
  late String content;
  late int followed;
  late String cover;
  late String picUrls;
  late String comments;
  late String likes;
  late String likeStatuses;
  late String followStatuses;
  late String senders;

  BtPost({
    required this.authorId,
    required this.authorName,
    required this.avatar,
    required this.title,
    required this.subTitle,
    required this.content,
    required this.followed,
    required this.cover,
    required this.picUrls,
    required this.comments,
    required this.likes,
    required this.likeStatuses,
    required this.followStatuses,
    required this.senders,
  });

  Map<String, dynamic> toMap() {
    var map = <String, dynamic>{};
    map[columnAuthorName] = authorName;
    map[columnAuthorId] = authorId;
    map[columnAvatar] = avatar;
    map[columnTitle] = title;
    map[columnSubTitle] = subTitle;
    map[columnContent] = content;
    map[columnFollowed] = followed;
    map[columnCover] = cover;
    map[columnPicUrls] = picUrls;
    map[columnComments] = comments;
    map[columnLikes] = likes;
    map[columnLikeStatuses] = likeStatuses;
    map[columnFollowStatuses] = followStatuses;
    map[columnSenders] = senders;
    return map;
  }

  BtPost.fromMap(Map<String, dynamic> map) {
    authorName = map[columnAuthorName];
    authorId = map[columnAuthorId];
    avatar = map[columnAvatar];
    title = map[columnTitle];
    subTitle = map[columnSubTitle];
    content = map[columnContent];
    followed = map[columnFollowed];
    cover = map[columnCover];
    picUrls = map[columnPicUrls];
    comments = map[columnComments];
    likes = map[columnLikes];
    likeStatuses = map[columnLikeStatuses];
    followStatuses = map[columnFollowStatuses];
    senders = map[columnSenders];
  }
}
